package com.blogs.web;

import com.blogs.common.redis.annotation.CacheLock;
import com.blogs.common.redis.annotation.CacheParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: xiaokai
 * @Description: 测试防止前端重复提交redis整合实现分布式锁
 * @Date: 2019/6/26
 * @Version: 1.0
 */
@RestController
@RequestMapping("/books")
public class BaseController {

    @CacheLock(prefix = "books")
    @GetMapping
    public String query(@CacheParam(name = "token") @RequestParam String token){
        return "success - " + token;

    }
}
